Skip to content

meta(changelog): Update changelog for 9.35.0 #16811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jul 4, 2025
Merged

Conversation

andreiborza
Copy link
Member

No description provided.

mydea and others added 16 commits July 1, 2025 12:52
Even if `parentSpanIsAlwaysRootSpan=true` is configured.

Fixes #16769
[Gitflow] Merge master into develop
This PR adds support for instrumenting and sending spans from
[`ElementTiming` API
](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/elementtiming)entries.
Just like with web vitals and long tasks/animation frames, we register a
`PerformanceObserver` and extract spans from newly emitted ET entries.

Important: 
- We'll by default emit ET spans. Users can opt out by setting
`enableElementTiming: false` in `browserTracingIntegration`
- We for now only emit an ET span, if there is an active parent span.
Happy to adjust this but considering the limitations from below I'm not
sure if we actually want all spans after the pageload span. For now,
we'll also emit spans on other transactions that pageload (most
prominently `navigation` spans as well). We could also go the route of
only sending until the first navigation as with standalone CLS/LCP
spans. Happy to accept any direction we wanna take this.
 
Some noteworthy findings while working on this:

- ET is only emitted for text and image nodes. 
- For image nodes, we get the `loadTime` which is the relative timestamp
to the browser's `timeOrigin`, when the image _finished_ loading. For
text nodes, `loadTime` is always `0`, since nothing needs to be loaded.
- For all nodes, we get `renderTime` which is the relative timestamp to
the browser's `timeOrigin`, when the node finished rendering (i.e. was
painted by the browser).
- In any case, we do not get start times for rendering or loading.
Consequently, the span duration is
  - `renderTime - loadTime` for image nodes
  - `0` for text nodes
- The span start time is:
  - `timeOrigin + loadTime` for image nodes
  - `timeOrigin + renderTime` for text nodes

In addition to the raw span and conventional attributes, we also collect
a bunch of ET-specific attributes:

- `element.type` - tag name of the element (e.g. `img` or `p`)
- `element.size` - width x height of the element
- `element.render-time` - `entry.renderTime`
- `element.load-time` - `entry.loadTime`
- `element.url` - url of the loaded image (`undefined` for text nodes)
- `element.identifier` - the identifier passed to the
`elementtiming=identifier` HTML attribute
- `element.paint-type` - the node paint type (`image-paint` or
`text-paint`)

also some additional sentry-sepcific attributes:
- `route` - the route name, either from the active root span (if
available) or from the scope's `transactionName`
- `sentry.span-start-time-source` - the data point we used as the span
start time

More than happy to adjust any of this logic or attribute names, based on
review feedback :)

closes #13675 
also ref #7292

---------

Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
Co-authored-by: s1gr1d <sigrid.huemer@posteo.at>
In order to not have all users of the SDK auto-install the
`@sentry/cloudflare` dependency, it's added as `peerDependency`.

ref #15597
I noticed that locally I sometimes have old tarballs lying around, which
are all published for E2E tests. This is unnecessary, and can also make
it a bit unreliable which version is used for tests (as we generally
have the dependencies as `*` which could be anything). This changes it
so we only publish the current version.
)

Not sure why we even have this, but this somehow breaks cloudflare-pages
E2E tests in some scenarios. It also seems simply unnecessary - or is
there a reason we have this? 🤔

Extracted this out from
#16783
This PR:
- Adds `eventLoopBlockIntegration` which uses
`@sentry-internal/node-native-stacktrace` to detect and capture blocked
event loops
- Adds suite of integration tests to test all the functionality
- Bundling
- Unlike the existing ANR integration, we can't bundle the worker code
into a base64 string because there is a native module and all threads
need to load the same native module
- The worker is loaded via `new Worker(new
URL('./thread-blocked-watchdog.js', import.meta.url))` which will be
bundled correctly by latest Vite and Webpack 5
- For other bundlers you can add an extra entry point pointing at
`@sentry/node-native/thread-blocked-watchdog` which should output
to`thread-blocked-watchdog.js` next to your bundle.

## Usage

If you instrument your application via the Node.js `--import` flag, this
instrumentation will be automatically applied to all worker threads.

`instrument.mjs`

```javascript
import * as Sentry from '@sentry/node';
import { eventLoopBlockIntegration } from '@sentry/node-native';

Sentry.init({
  dsn: '__YOUR_DSN__',
  // Capture stack traces when the event loop is blocked for more than 500ms
  integrations: [eventLoopBlockIntegration({ 
    threshold: 500, // defaults to 1000 ms 
    maxEventsPerHour: 5,  // defaults to 1
  })],
});
```

`app.mjs`

```javascript
import { Worker } from 'worker_threads';

const worker = new Worker(new URL('./worker.mjs', import.meta.url));

// This main thread will be monitored for blocked event loops
```

`worker.mjs`

```javascript
// This worker thread will also be monitored for blocked event loops too

setTimeout(() => {
  longWork();
}, 2_000);
```

Start your application:

```bash
node --import instrument.mjs app.mjs
```

Blocked events are captured with stack traces for all threads:

<img width="892" alt="image"
src="https://github.com/user-attachments/assets/4990eff1-46f9-4a1d-83c7-868493a126d5"
/>

---------

Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
Make changes to the Vercel AI integration as per
https://www.notion.so/sentry/Agent-Monitoring-SDK-differences-21c8b10e4b5d80bcab51f72ae1418ea8

AI summary:

### Key Improvements:
1. **Eliminated duplicate attributes** - Tool call and prompt attributes
are now renamed instead of duplicated
2. **Added tool input/output support** - New `gen_ai.tool.input` and
`gen_ai.tool.output` attributes
3. **Auto-sets tool type** - Automatically adds `gen_ai.tool.type:
'function'` for tool calls
4. **Better OpenTelemetry compliance** - Cleaner attribute mapping
following semantic conventions

### Technical Changes:
- Uses `renameAttributeKey()` consistently instead of duplicating
attributes
- Removes old `ai.*` attributes after creating new `gen_ai.*` ones
Nestjs sync task has the same issue as async tasks - they don't care
about exceptions because nestjs `@Cron()` decorator automatically wraps
it to `try-catch` block and logs an error. That's why we should capture
exception in our `@SentryCron()` decorator.
Fixes also #16749

- [ ] If you've added code that should be tested, please add tests.
- [x] Ensure your code lints and the test suite passes (`yarn lint`) &
(`yarn test`).

---------

Co-authored-by: cod1k <cod1k@centro.team>
Co-authored-by: Andrei <168741329+andreiborza@users.noreply.github.com>
Noticed #16783 in the
nuxt-3-min test, that the plugins are not consistently run apparently.
In that test, the client integrations plugin was run before the client
config plugin, leading to the client not existing yet, and thus not
adding the browser tracing integration.

This PR changes this to ensure we have a consistent order of these
plugins.
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #16792

Co-authored-by: andreiborza <168741329+andreiborza@users.noreply.github.com>
Hopefully fixes
#16491

I could not get a reproducing test there for this 🤔 I figure this is
"safe" to do, but not quite sure how/when this would happen. I would
assume this was "introduced" by
#15995, maybe @Fryuni
has a clue how/when that could happen and if this is a reasonable change
🤔
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #16763

Co-authored-by: chargome <20254395+chargome@users.noreply.github.com>
Co-authored-by: Francesco Gringl-Novy <francesco.novy@sentry.io>
@andreiborza andreiborza force-pushed the prepare-release/9.35.0 branch from ffd67e5 to 1a1c19d Compare July 4, 2025 10:19
Copy link
Contributor

github-actions bot commented Jul 4, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.99 kB added added
@sentry/browser - with treeshaking flags 23.76 kB added added
@sentry/browser (incl. Tracing) 39.59 kB added added
@sentry/browser (incl. Tracing, Replay) 77.69 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.78 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 82.45 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 94.57 kB added added
@sentry/browser (incl. Feedback) 40.75 kB added added
@sentry/browser (incl. sendFeedback) 28.7 kB added added
@sentry/browser (incl. FeedbackAsync) 33.59 kB added added
@sentry/react 25.76 kB added added
@sentry/react (incl. Tracing) 41.58 kB added added
@sentry/vue 28.37 kB added added
@sentry/vue (incl. Tracing) 41.4 kB added added
@sentry/svelte 24.01 kB added added
CDN Bundle 25.5 kB added added
CDN Bundle (incl. Tracing) 39.6 kB added added
CDN Bundle (incl. Tracing, Replay) 75.5 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 80.96 kB added added
CDN Bundle - uncompressed 74.5 kB added added
CDN Bundle (incl. Tracing) - uncompressed 117.63 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.68 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 244.5 kB added added
@sentry/nextjs (client) 43.22 kB added added
@sentry/sveltekit (client) 40.04 kB added added
@sentry/node 162.03 kB added added
@sentry/node - without tracing 98.64 kB added added
@sentry/aws-serverless 124.4 kB added added

@andreiborza andreiborza merged commit dc3b94c into master Jul 4, 2025
161 of 162 checks passed
@andreiborza andreiborza deleted the prepare-release/9.35.0 branch July 4, 2025 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants